package Ex3;

import java.util.Iterator;

public interface Map<K,V> {

	/**
	 * Returns the value corresponding to the key k. Returns null, if the
	 * key is not in the map.
	 * Input: K Output: V
	 */
	public V get(K k);

	
	/**
	 * Inserts a (key, value)-pair in the map with k as the key and v as the
	 * value. Returns the old value, if the key k was in the map before this
	 * insertion. If not, returns null. Neither the key k, nor the value v can
	 * be null.
	 * Input: K, V Output: V
	 */
	public V put(K k, V v);

	/**
	 * Removes the (key, value)-pair with key k from the map. Returns the
	 * value, if the key was in the map before this removal. If not, returns
	 * null.
	 * Input: K Output: V
	 */
	public V remove(K k);

	/**
	 * Returns an iterator with all the keys in the map.
	 * Input: None Output: Iterator<K>
	 */
	public Iterator<K> keys();

	/**
	 * Returns an iterator with all the values in the map.
	 * Input: None Output: Iterator<V>
	 */
	public Iterator<V> values();

	/**
	 * Returns the number of (key,value)-pairs in the map.
	 * Input: None Output: int
	 */
	public int size();

	/**
	 * Returns true on an empty map, false on a non-empty map.
	 * Input: None Output: boolean.
	 */
	public boolean isEmpty();
	
}
